package com.haier.npt.sso.i18n;

import com.haier.npt.exception.ExceptionResolvable;

/**
 * <p></p>
 *
 * @author wangjb-c
 * @Since 2018/1/8
 */
public enum SSOExceptionCode implements ExceptionResolvable {


    SUCCESS                                      (0,"sso.success"),

    CAPTCHA_ERROR                                (10005,"sso.captcha.error"),
    SYS_APP_ERROR                                (11008,"sso.sys.app.error"),
    TOKEN_INVALID                                (12009,"sso.token.invalid"),
    SYS_APP_NOT_ALLOW_LOGIN                      (11010,"sso.sys.app.not.allow.login"),
    USER_LOGIN_FAILED 		                     (11012,"sso.user.login.failed"),
    FETCH_USER_INFO_ERROR                        (11013,"sso.fetch.user.info.error"),

    ;


    private Integer code;

    private String message;

    SSOExceptionCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return getMessage(message);
    }

}
